﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Catsland.Core;

namespace Catsland.CatsPlugin
{
	class TestTriaggerInvoker : TriagerInvoker
	{
		public void EnterTrigger(Collider trigger, Collider invoker)
		{
			/*
			Console.WriteLine("Enter trigger.");
			Mgr<DialogBox>.Singleton.m_text = "按下E和Q可以上下楼梯";
			Mgr<DialogBox>.Singleton.m_leftTop = new Point(10, 10);
			Mgr<DialogBox>.Singleton.m_rightBottom = new Point(400, 400);
			Mgr<DialogBox>.Singleton.m_enable = true;
			
			CharacterController characterController = invoker.m_gameObject.m_characterController;
			if ( characterController != null)
			{
				characterController.m_canClimb = true;
			}
			Mgr<GameEngine>.Singleton.DelayReleaseScene();
			 */
			Console.WriteLine("Enter trigger.");
            DialogAnimator dialogAnimator = (DialogAnimator)trigger.m_gameObject.GetComponent(typeof(DialogAnimator).Name);
            if (dialogAnimator != null)
            {
                dialogAnimator.CheckAndPlayDialog(0, 2);
            }
            
		}

		public void InTrigger(Collider trigger, Collider invoker)
		{
			
		}

		public void ExitTrigger(Collider trigger, Collider invoker)
		{
			/*
			Console.WriteLine("Exit trigger.");
			Mgr<DialogBox>.Singleton.m_enable = false;
			CharacterController characterController = invoker.m_gameObject.m_characterController;
			if (characterController != null)
			{
				characterController.m_canClimb = false;
			}
			 */
		}
	}
}
